//
//  HSHomeworkCell.swift
//  HomeSchoolDemo
//
//  Created by Mac on 16/10/11.
//  Copyright © 2016年 chendong. All rights reserved.
//

import UIKit

class HSHomeworkCell: UITableViewCell {

    @IBOutlet weak var homeworkLabel: UILabel!
    
    @IBOutlet weak var subStatusView: UIImageView!
    
    @IBOutlet weak var homeworkTeacherName: UILabel!
    
    @IBOutlet weak var courseNameLable: UILabel!
    
    @IBOutlet weak var createDateLabel: UILabel!
    
    //数据类型
    var homeworkVM: HSHomeworkViewModel?{
        didSet{
            homeworkLabel.text = homeworkVM?.homework.hw_title
            homeworkTeacherName.text = homeworkVM?.homework.hw_tName
            courseNameLable.text = homeworkVM?.homework.courseName
            createDateLabel.text = homeworkVM?.homework.hw_createDate
            
            if homeworkVM?.homework.subStatus == 0{
                subStatusView.image = UIImage(named: "hw_base_commit")
            }else{
                subStatusView.image = UIImage(named: "hw_base_no_commit")
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        setupUI()
        
    }
    
    fileprivate func setupUI(){
        courseNameLable.textColor = UIColor().colorWithHex(0x00a0e9)
        courseNameLable.layer.cornerRadius = 7
        courseNameLable.layer.borderWidth = 1
        courseNameLable.layer.borderColor = UIColor().colorWithHex(0x00a0e9).cgColor
        courseNameLable.layer.masksToBounds = true
    }
    
    
}
